package com.geek.aware;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AwareConfig.class)) {
            AwareService awareService = context.getBean(AwareService.class);
            awareService.outputResult();
        }

        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TaskExecutorConfig.class)) {
            AsyncTaskService asyncTaskService = context.getBean(AsyncTaskService.class);
            for (int i = 0; i < 10; i++) {
                asyncTaskService.executeAsyncTask(i);
                asyncTaskService.executeAsyncTaskPlus(i);
            }
        }
        try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TaskSchedulerConfig.class)) {

        }
    }
}
